return Def.ActorFrame{
	Def.ActorFrame{
		Name="DangerP1";
		Def.ActorFrame{
			Name="Single";
			BeginCommand=function(self)
				local style = GAMESTATE:GetCurrentStyle()
				local styleType = style:GetStyleType()
				local styleMode = GAMESTATE:GetCurrentStyle(pn):GetStepsType()
				local bDoubles = (styleType == 'StyleType_OnePlayerTwoSides' or styleType == 'StyleType_TwoPlayersSharedSides')
				local bSolos = (styleType == 'StyleType_OnePlayerOneSide' and styleMode == 'StepsType_Dance_Solo')
				if GAMESTATE:PlayerIsUsingModifier(PLAYER_1,"battery") == false or GAMESTATE:PlayerIsUsingModifier(PLAYER_2,"battery") == false then
					if not bDoubles and not bSolos then
						self:visible(true);
					else
						self:visible(false);
					end;
				else
					self:visible(false);
				end;
			end;
			HealthStateChangedMessageCommand=function(self, param)
				if param.PlayerNumber == PLAYER_1 then
					if param.HealthState == "HealthState_Danger" then
						self:RunCommandsOnChildren(cmd(playcommand,"Show"))
					else
						self:RunCommandsOnChildren(cmd(playcommand,"Hide"))
					end
				end
			end;
			LoadActor(THEME:GetPathB("_shared","danger/single"))..{
				InitCommand=cmd(stretchto,SCREEN_LEFT,SCREEN_TOP,SCREEN_CENTER_X,SCREEN_BOTTOM;diffusealpha,0;);
				ShowCommand=cmd(linear,0.3;diffusealpha,1;diffuseshift;effectcolor1,color("1,0,0,1");effectcolor2,color("1,1,1,0.5");effectperiod,0.5);
				HideCommand=cmd(stopeffect;stoptweening;linear,.5;diffusealpha,0);
			};
			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(x,SCREEN_LEFT+40;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0,0,1");texcoordvelocity,0,0.3;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};
			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(x,SCREEN_LEFT+16;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0,0.3,1");texcoordvelocity,0,1.4;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};
			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(x,SCREEN_LEFT+60;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0.5,0,1");texcoordvelocity,0,-0.6;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};
		};
	};
	Def.ActorFrame{
		Name="DangerP2";
		Def.ActorFrame{
			Name="Single";
			BeginCommand=function(self)
				local style = GAMESTATE:GetCurrentStyle()
				local styleType = style:GetStyleType()
				local styleMode = GAMESTATE:GetCurrentStyle(pn):GetStepsType()
				local bDoubles = (styleType == 'StyleType_OnePlayerTwoSides' or styleType == 'StyleType_TwoPlayersSharedSides')
				local bSolos = (styleType == 'StyleType_OnePlayerOneSide' and styleMode == 'StepsType_Dance_Solo')
				if GAMESTATE:PlayerIsUsingModifier(PLAYER_1,"battery") == false or GAMESTATE:PlayerIsUsingModifier(PLAYER_2,"battery") == false then
					if not bDoubles and not bSolos then
						self:visible(true);
					else
						self:visible(false);
					end;
				else
					self:visible(false);
				end;
			end;
			HealthStateChangedMessageCommand=function(self, param)
				if param.PlayerNumber == PLAYER_2 then
					if param.HealthState == "HealthState_Danger" then
						self:RunCommandsOnChildren(cmd(playcommand,"Show"))
					else
						self:RunCommandsOnChildren(cmd(playcommand,"Hide"))
					end
				end
			end;
			LoadActor(THEME:GetPathB("_shared","danger/single"))..{
				InitCommand=cmd(rotationy,180;stretchto,SCREEN_CENTER_X,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM;diffusealpha,0;);
				ShowCommand=cmd(linear,0.3;diffusealpha,1;diffuseshift;effectcolor1,color("1,0,0,1");effectcolor2,color("1,1,1,0.5");effectperiod,0.5);
				HideCommand=cmd(stopeffect;stoptweening;linear,.5;diffusealpha,0);
			};
			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(rotationx,180;rotationy,180;x,SCREEN_RIGHT-40;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0,0,1");texcoordvelocity,0,0.3;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};
			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(rotationx,180;rotationy,180;x,SCREEN_RIGHT-16;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0,0.3,1");texcoordvelocity,0,1.4;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};
			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(rotationx,180;rotationy,180;x,SCREEN_RIGHT-60;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0.5,0,1");texcoordvelocity,0,-0.6;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};
		};
	};
	
	Def.ActorFrame{
		Name="DangerSoloDouble";
		Def.ActorFrame{
			Name="SoloDouble";
			BeginCommand=function(self)
				local style = GAMESTATE:GetCurrentStyle()
				local styleType = style:GetStyleType()
				local styleMode = GAMESTATE:GetCurrentStyle(pn):GetStepsType()
				local bDoubles = (styleType == 'StyleType_OnePlayerTwoSides' or styleType == 'StyleType_TwoPlayersSharedSides')
				local bSolos = (styleType == 'StyleType_OnePlayerOneSide' and styleMode == 'StepsType_Dance_Solo')
				if GAMESTATE:PlayerIsUsingModifier(PLAYER_1,"battery") == false or GAMESTATE:PlayerIsUsingModifier(PLAYER_2,"battery") == false then
					if bSolos then
						self:visible(true);
					elseif bDoubles then
						self:visible(true);
					else
						self:visible(false);
					end;
				else
					self:visible(false);
				end;
			end;
			HealthStateChangedMessageCommand=function(self, param)
				if param.PlayerNumber == PLAYER_1 then
					if param.HealthState == "HealthState_Danger" then
						self:RunCommandsOnChildren(cmd(playcommand,"Show"))
					else
						self:RunCommandsOnChildren(cmd(playcommand,"Hide"))
					end
				end	
				if param.PlayerNumber == PLAYER_2 then
					if param.HealthState == "HealthState_Danger" then
						self:RunCommandsOnChildren(cmd(playcommand,"Show"))
					else
						self:RunCommandsOnChildren(cmd(playcommand,"Hide"))
					end
				end
			end;
			LoadActor(THEME:GetPathB("_shared","danger/double"))..{
				InitCommand=cmd(rotationy,180;stretchto,SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM;diffusealpha,0;);
				ShowCommand=cmd(linear,0.3;diffusealpha,1;diffuseshift;effectcolor1,color("1,0,0,1");effectcolor2,color("1,1,1,0.5");effectperiod,0.5);
				HideCommand=cmd(stopeffect;stoptweening;linear,.5;diffusealpha,0);
			};
			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(rotationx,180;rotationy,180;x,SCREEN_LEFT+16;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0,0.3,1");texcoordvelocity,0,1.4;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};
			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(rotationx,180;rotationy,180;x,SCREEN_LEFT+40;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0.5,0,1");texcoordvelocity,0,0.3;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};

			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(rotationx,180;rotationy,180;x,SCREEN_RIGHT-16;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0,0.3,1");texcoordvelocity,0,1.4;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};
			LoadActor(THEME:GetPathB("_shared","danger/dangerline"))..{
				InitCommand=cmd(rotationx,180;rotationy,180;x,SCREEN_RIGHT-40;y,SCREEN_CENTER_Y;zoomto,32,SCREEN_HEIGHT;diffusealpha,0;customtexturerect,0,0,1,SCREEN_HEIGHT/self:GetHeight();ztest,true;);
				ShowCommand=cmd(diffuse,color("1,0.5,0,1");texcoordvelocity,0,-0.6;);
				HideCommand=cmd(stopeffect;stoptweening;linear,0.25;diffusealpha,0;);
			};
		};
	};
};